import 'package:flutter_cwhisky/generated/json/base/json_convert_content.dart';
import 'package:flutter_cwhisky/bean/good_entity.dart';

GoodEntity $GoodEntityFromJson(Map<String, dynamic> json) {
	final GoodEntity goodEntity = GoodEntity();
	final int? goodsId = jsonConvert.convert<int>(json['goodsId']);
	if (goodsId != null) {
		goodEntity.goodsId = goodsId;
	}
	final String? goodsCode = jsonConvert.convert<String>(json['goodsCode']);
	if (goodsCode != null) {
		goodEntity.goodsCode = goodsCode;
	}
	final String? image = jsonConvert.convert<String>(json['image']);
	if (image != null) {
		goodEntity.image = image;
	}
	final String? cnName = jsonConvert.convert<String>(json['cnName']);
	if (cnName != null) {
		goodEntity.cnName = cnName;
	}
	final String? enName = jsonConvert.convert<String>(json['enName']);
	if (enName != null) {
		goodEntity.enName = enName;
	}
	final int? promotionType = jsonConvert.convert<int>(json['promotionType']);
	if (promotionType != null) {
		goodEntity.promotionType = promotionType;
	}
	final double? marketPrice = jsonConvert.convert<double>(json['marketPrice']);
	if (marketPrice != null) {
		goodEntity.marketPrice = marketPrice;
	}
	final dynamic series = jsonConvert.convert<dynamic>(json['series']);
	if (series != null) {
		goodEntity.series = series;
	}
	final String? placeOfOrigin = jsonConvert.convert<String>(json['placeOfOrigin']);
	if (placeOfOrigin != null) {
		goodEntity.placeOfOrigin = placeOfOrigin;
	}
	final int? salesCount = jsonConvert.convert<int>(json['salesCount']);
	if (salesCount != null) {
		goodEntity.salesCount = salesCount;
	}
	final int? minOrderQuantity = jsonConvert.convert<int>(json['minOrderQuantity']);
	if (minOrderQuantity != null) {
		goodEntity.minOrderQuantity = minOrderQuantity;
	}
	final int? usableIntegral = jsonConvert.convert<int>(json['usableIntegral']);
	if (usableIntegral != null) {
		goodEntity.usableIntegral = usableIntegral;
	}
	final List<dynamic>? salesFlag = jsonConvert.convertListNotNull<dynamic>(json['salesFlag']);
	if (salesFlag != null) {
		goodEntity.salesFlag = salesFlag;
	}
	final int? balanceCount = jsonConvert.convert<int>(json['balanceCount']);
	if (balanceCount != null) {
		goodEntity.balanceCount = balanceCount;
	}
	final double? price = jsonConvert.convert<double>(json['price']);
	if (price != null) {
		goodEntity.price = price;
	}
	final double? promotionPrice = jsonConvert.convert<double>(json['promotionPrice']);
	if (promotionPrice != null) {
		goodEntity.promotionPrice = promotionPrice;
	}
	final double? showPrice = jsonConvert.convert<double>(json['showPrice']);
	if (showPrice != null) {
		goodEntity.showPrice = showPrice;
	}
	final int? showPriceType = jsonConvert.convert<int>(json['showPriceType']);
	if (showPriceType != null) {
		goodEntity.showPriceType = showPriceType;
	}
	final int? cartItemCount = jsonConvert.convert<int>(json['cartItemCount']);
	if (cartItemCount != null) {
		goodEntity.cartItemCount = cartItemCount;
	}
	final List<GoodAttrValueList>? attrValueList = jsonConvert.convertListNotNull<GoodAttrValueList>(json['attrValueList']);
	if (attrValueList != null) {
		goodEntity.attrValueList = attrValueList;
	}
	final String? brandEnName = jsonConvert.convert<String>(json['brandEnName']);
	if (brandEnName != null) {
		goodEntity.brandEnName = brandEnName;
	}
	final String? brandCode = jsonConvert.convert<String>(json['brandCode']);
	if (brandCode != null) {
		goodEntity.brandCode = brandCode;
	}
	return goodEntity;
}

Map<String, dynamic> $GoodEntityToJson(GoodEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['goodsId'] = entity.goodsId;
	data['goodsCode'] = entity.goodsCode;
	data['image'] = entity.image;
	data['cnName'] = entity.cnName;
	data['enName'] = entity.enName;
	data['promotionType'] = entity.promotionType;
	data['marketPrice'] = entity.marketPrice;
	data['series'] = entity.series;
	data['placeOfOrigin'] = entity.placeOfOrigin;
	data['salesCount'] = entity.salesCount;
	data['minOrderQuantity'] = entity.minOrderQuantity;
	data['usableIntegral'] = entity.usableIntegral;
	data['salesFlag'] =  entity.salesFlag;
	data['balanceCount'] = entity.balanceCount;
	data['price'] = entity.price;
	data['promotionPrice'] = entity.promotionPrice;
	data['showPrice'] = entity.showPrice;
	data['showPriceType'] = entity.showPriceType;
	data['cartItemCount'] = entity.cartItemCount;
	data['attrValueList'] =  entity.attrValueList?.map((v) => v.toJson()).toList();
	data['brandEnName'] = entity.brandEnName;
	data['brandCode'] = entity.brandCode;
	return data;
}

GoodAttrValueList $GoodAttrValueListFromJson(Map<String, dynamic> json) {
	final GoodAttrValueList goodAttrValueList = GoodAttrValueList();
	final String? cnName = jsonConvert.convert<String>(json['cnName']);
	if (cnName != null) {
		goodAttrValueList.cnName = cnName;
	}
	final String? attributeValue = jsonConvert.convert<String>(json['attributeValue']);
	if (attributeValue != null) {
		goodAttrValueList.attributeValue = attributeValue;
	}
	return goodAttrValueList;
}

Map<String, dynamic> $GoodAttrValueListToJson(GoodAttrValueList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['cnName'] = entity.cnName;
	data['attributeValue'] = entity.attributeValue;
	return data;
}